// Upgrade NOTE: commented out 'float4 unity_LightmapST', a built-in variable
// Upgrade NOTE: commented out 'float4x4 _World2Object', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'


Shader  "Custom/DiffuseNoLightMap" {

	Properties
	 {
 _MainTex ("Texture 1", 2D) = "white" {}
 _Light0 ("Light0", Vector) = (0.5,-1,0.5,0)
 _Light1 ("Light1", Vector) = (0,0,0.1,0)
 _Light2 ("Light2", Vector) = (0.15,0,0.15,0)
 _LightColour0 ("Light colour 0", Color) = (1,0.73,0.117,0)
 _LightColour1 ("Light colour 1", Color) = (0.05,0.275,0.275,0)
 _LightColour2 ("Light colour 2", Color) = (0,0,0,0)
 _AmbientColour1 ("Ambient Light colour", Color) = (0.5,0.5,0.5,0)
 _LightTint ("Light Tint", Color) = (1,1,1,0)
 _UseLightMap ("Use light map", Float) = 1
}

	

	SubShader
     {
  Tags { "LIGHTMODE"="ForwardBase" "RenderType"="Opaque" }

    LOD 100
	Pass
	{
	
	

	CGPROGRAM
	#pragma vertex vert
	#pragma fragment frag
	#include "UnityCG.cginc"
    //#define Fixed3(value)  fixed3(value, value,value)

	struct VertexInput {
    fixed4 vertex : POSITION;
	fixed2 xlv_TEXCOORD0 : TEXCOORD0;
    fixed2 xlv_TEXCOORD1 : TEXCOORD1;
    //fixed3 xlv_TEXCOORD2 : TEXCOORD2;
    //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
    //fixed4 tangent : TANGENT;
    fixed3 normal : NORMAL;
    //fixed4 xlv_COLOR : COLOR;
	//VertexInput
	};


	struct VertexOutput {
	fixed4 pos : SV_POSITION;
    UNITY_FOG_COORDS(1)
    //fixed4 xlv_COLOR : COLOR;
	fixed2 xlv_TEXCOORD0 : TEXCOORD0;
    fixed2 xlv_TEXCOORD1 : TEXCOORD1;
    fixed3 xlv_TEXCOORD2 : TEXCOORD2;
    //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
    //fixed3 xlv_TEXCOORD4 : TEXCOORD4;
	//VertexOutput
	};


 // float4x4 _World2Object;
 // float4 unity_LightmapST;
 float4 _MainTex_ST;
 fixed4 _Light0;
 fixed4 _Light1;
 fixed4 _Light2;
 fixed4 _LightColour0;
 fixed4 _LightColour1;
 fixed4 _LightColour2;
 fixed4 _AmbientColour1;


 sampler2D _MainTex;
 fixed4 _LightTint;


	VertexOutput vert (VertexInput v)
	{
	VertexOutput o;
	//o.pos = UnityObjectToClipPos (v.vertex);
	//o.xlv_TEXCOORD0 = TRANSFORM_TEX(v.xlv_TEXCOORD0, _MainTex);
	
  float3 lightDirection3_1;
  float3 lightDirection2_2;
  float3 lightDirection_3;
  fixed3 tmpvar_4;
  tmpvar_4 = normalize(_Light0).xyz;
  lightDirection_3 = tmpvar_4;
  fixed3 tmpvar_5;
  tmpvar_5 = normalize(_Light1).xyz;
  lightDirection2_2 = tmpvar_5;
  fixed3 tmpvar_6;
  tmpvar_6 = normalize(_Light2).xyz;
  lightDirection3_1 = tmpvar_6;
  float4 tmpvar_7;
  tmpvar_7.w = 0.0;
  tmpvar_7.xyz = normalize(v.normal);
  float3 tmpvar_8;
  tmpvar_8 = normalize(mul(tmpvar_7 , unity_WorldToObject).xyz);
  o.pos = UnityObjectToClipPos( v.vertex);
  o.xlv_TEXCOORD0 = ((v.xlv_TEXCOORD0 * _MainTex_ST.xy) + _MainTex_ST.zw);
  o.xlv_TEXCOORD1 = ((v.xlv_TEXCOORD1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
  o.xlv_TEXCOORD2 = (((
    clamp ((-(_LightColour0) * dot (tmpvar_8, lightDirection_3)), 0.0, 1.0)
  .xyz + 
    clamp ((-(_LightColour1) * dot (tmpvar_8, lightDirection2_2)), 0.0, 1.0)
  .xyz) + clamp (
    (-(_LightColour2) * dot (tmpvar_8, lightDirection3_1))
  , 0.0, 1.0).xyz) + _AmbientColour1.xyz);



    UNITY_TRANSFER_FOG(o,o.vertex);
   
	return o;
	}


	fixed4 frag(VertexOutput i) : SV_Target
    {
    //fixed4 tmpvar_2 = tex2D(_MainTex, i.uv);
	
  half4 main_color_1;
  fixed4 tmpvar_2;
  tmpvar_2 = tex2D (_MainTex, i.xlv_TEXCOORD0);
	UNITY_APPLY_FOG(i.fogCoord, tmpvar_2);
  float3 tmpvar_3;
  tmpvar_3 = ((_LightTint.xyz * i.xlv_TEXCOORD2) * tmpvar_2.xyz);
  main_color_1.xyz = tmpvar_3;
  main_color_1.w = 1.0;
  return main_color_1;

	}
	ENDCG
	}
  }
Fallback "Diffuse"
}

